Previous Book Contents Book Index Next

Inside Macintosh: Programming With JManager /
Chapter 2 - JManager Reference / JManager Constants and Data Types
The Applet Object


Applet Callbacks Structure

When you instantiate an applet using the JMNewAppletViewer function, you must pass a data structure that supplies callback information for the applet. This data structure is defined by the JMAppletViewerCallbacks data type.

struct JMAppletViewerCallbacks {
   UInt32            fVersion;   
   JMShowDocumentProcPtr fShowDocument;
   JMSetStatusMsgProcPtr fSetStatusMsg;
};
Field Description
fVersion
The version of JManager. You should set this field to kJMVersion.
fShowDocument
A pointer to a function that displays the contents of a URL passed to it, possibly in a new window. This callback function has the following type definition:
               typedef void (*JMShowDocumentProcPtr) (
                  JMAppletViewerRef viewer, 
                  const JMTextRef urlString, 
                  const JMTextRef windowName);
For more information, see the description of the application-defined function MyShowDocument.
fSetStatusMsg
A pointer to a function that handles messages from the applet. The client application can display the message (in a status bar, for example) or ignore it. This callback function has the following type definition:
               typedef void (*JMSetStatusMsgProcPtr) (
                  JMAppletViewerRef viewer, 
                  const JMTextRef statusMsg);
For more information, see the description of the application-defined function MySetStatusMsg.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
10 DEC 1997